<template>
	<view>
		<image class="topImg" :src="banner_list.image" mode=""></image>
		<view class="box">
			<view class="row" v-for="(item,index) in list.goods_list" @click="getTo(item.id)">
				<view class="imgBox">
					<image class="serial" v-if="index==0" src="../static/image/Groupx1.png" mode=""></image>
					<image class="serial" v-if="index==1" src="../static/image/Groupx2.png" mode=""></image>
					<image class="serial" v-if="index==2" src="../static/image/Groupx3.png" mode=""></image>
					<image class="serial" v-if="index==3" src="../static/image/Groupx4.png" mode=""></image>
					<view class="price"><price-format :color="'#FFFFFF'" class="m-r-10" :first-size="28" :second-size="26"
					:subscript-size="26" :price="item.min_price" :weight="500"></price-format></view>
					<image class="shopImg" :src="item.image" mode=""></image>
				</view>
				<view class="content">
					<view class="name ellipsis02">{{item.name}}</view>
					<view class="remark">{{item.remark}}</view>
				</view>
				
			</view>
		</view>
		<image class="bottomImg" :src="bottom_list.image" mode=""></image>
	</view>
</template>
 
<script setup>
	import {recommend} from '@/api/store';
	export default {
		data() {
			return {
				shop_id:'',
				list:[],
				banner_list:[],
				bottom_list:[],
			}
		},
		onLoad(option) {
			// this.shop_id = option.id;
			this.shop_id = uni.getStorageSync('bao_shopId')
			this.getrecommend()
		},
		methods: {
			getTo(id){
				uni.navigateTo({
					url:'/bundle/pages/goodsDetail/index?id='+id
				})
			},
			getrecommend(){
				recommend({
					shop_id:this.shop_id
				}).then(({
					data
				}) => {
				this.list= data;
				this.banner_list= data.banner_list;
				this.bottom_list= data.bottom_list;
				})
			},
		}
	}
</script>

<style>
	page{
		background-color: #fdf7ed;
		padding-bottom: 60rpx;
	}
	.box{
		display: flex;
		flex-wrap:wrap;
		padding-top: 30rpx;
	}
	.topImg{
		width: 750rpx;
		height: 390rpx;
	}
	.row{
		width: 300rpx;
		margin-left: 50rpx;
		margin-bottom: 60rpx;
		margin-top: 20rpx;
	}
	.imgBox{
		position: relative;
		text-align: center;
		width: 92%;
		margin: 0 auto;
		border-radius: 10rpx;
		/* background-color: #fff; */
	}
	.price{
		background-color: #eb746e;
		width: 110rpx;
		font-size: 28rpx;
		color: #ffffff;
		position: absolute;
		top: 0;
		z-index: 20;
		text-align: center;
		padding: 2rpx 0;
		padding-left: 8rpx;
	}
	.shopImg{
		width: 100%;
		height: 228rpx;
		z-index: 9;
	}
	.content{
		background-color: #f0d5ad;
		height: 200rpx;
		margin-top: -80rpx;
		padding-top: 82rpx;
		text-align: center;
	}
	.name{
		margin-top: 4rpx;
		padding: 0 8rpx;
		font-size: 24rpx;
		color: #000;
	}
	.remark{
		font-size: 22rpx;
		color: #7C141C;
		margin-top: 4rpx;
	}
	.bottomImg{
		width: 676rpx;
		height: 192rpx;
		margin-left: 34rpx;
	}
	.serial{
		z-index: 21;
		width: 76rpx;
		height: 76rpx;
		position: absolute;
		right: -20rpx;
		top: -20rpx;
	}
</style>
